package com.xy6.struct.queue;

/**
 * 队列测试类
 * 
 * @author zhang
 *
 */
public class QueueTest {

	public static void main(String[] args) {
//		test1();
//		testPriorityQ();
//		testPriorityQ2();
		testPriorityQ3();
	}
	
	public static void test1(){
		Queue<Integer> q = new Queue<>();
		q.push(3);
		q.push(1);
		q.push(2);
		q.print();
		
		System.out.println("pop " + q.pop());
		q.print();
		System.out.println("pop " + q.pop());
		q.print();
		System.out.println("push 5 " + q.push(5));
		q.print();
	}
	
	public static void testPriorityQ(){
		PriorityQueue<Integer> q = new PriorityQueue<>();
		q.push(3);
		q.push(1);
		q.push(2);
		q.print();
		
		System.out.println("pop " + q.pop());
		q.print();
		System.out.println("pop " + q.pop());
		q.print();
		q.push(5);
		q.push(0);
		q.push(3);
		q.push(3);
		q.print();
		System.out.println("size: " + q.size());
	}
	
	public static void testPriorityQ2(){
		PriorityQueue2 q = new PriorityQueue2();
		q.push(3);
		q.push(1);
		q.push(2);
		q.print();
		
		System.out.println("pop " + q.pop());
		q.print();
		System.out.println("pop " + q.pop());
		q.print();
		q.push(5);
		q.push(0);
		q.push(3);
		q.push(3);
		q.print();
		System.out.println("size: " + q.size());
	}
	
	public static void testPriorityQ3(){
		PriorityQueue2 q = new PriorityQueue2();
		q.push(5);
		q.push(3);
		q.push(4);
		q.push(2);
		q.push(1);
		q.print();
		
		q.pop();
		q.print();
	}

}
